/**
 * @author liangxi
 * @since 2023/12/21
 */

#ifndef DESIGNPATTERN_SIMPLEPIZZAFACTORY_H
#define DESIGNPATTERN_SIMPLEPIZZAFACTORY_H


#include "Pizza.h"
#include "impl/CheesePizza.h"
#include "impl/VeggiePizza.h"
#include "impl/PepperoniPizza.h"
#include "impl/ClamPizza.h"

namespace Factory_SF {
    class SimplePizzaFactory {
    public:
        Factory_SF::Pizza creatPizza(const std::string &type) {
            if (type == "cheese") {
                return Factory_SF::CheesePizza();
            } else if (type == "pepperoni") {
                return Factory_SF::PepperoniPizza();
            } else if (type == "clam") {
                return Factory_SF::ClamPizza();
            } else if (type == "veggie") {
                return Factory_SF::VeggiePizza();
            }
            return {};
        }
    };
}

#endif //DESIGNPATTERN_SIMPLEPIZZAFACTORY_H
